package com.day4;

import java.util.Random;
import java.util.Scanner;

public class Day04 {
    public static void main(String[] xc){
        Random r=new Random();
        int n=r.nextInt(100)+1;
        Scanner t=new Scanner(System.in);
        for (;;){
            System.out.println("请输入一个整数：");
            int m=t.nextInt();
            if (n==m){
                System.out.println("猜对了！");
                System.out.println("是否继续,继续请按1");
                int x=t.nextInt();
                if (x==1){
                    n=r.nextInt(100)+1;
                }else {
                    System.out.println("gameover");
                    break;
                }
            }else if (n>m){
                System.out.println("您输入的数字小了");
            }else {
                System.out.println("您输入的数字大了");
            }
        }
    }


}
